<?php session_start();
	include('../controller/functions.php');
	User::connection();


	$userArr	= array('admin');
	if(!in_array($_SESSION['user'],$userArr)) {
	User::validSession();

}
if ($_GET['q'] == 'logout') 
{
	User::user_logout();
		print '		
			<script type="text/javascript">		
			window.location = "../login_r.php";
			</script>
			';

}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="../images/fav.ico">
<link rel="icon" type="image/gif" href="../images/fav.ico">
<title>Welcome! <? User::titleUser(); ?></title>

	<link rel="stylesheet" href="../css/style2.css" type="text/css" charset="utf-8" />
    <link rel="stylesheet" href="../css/front.css" type="text/css" charset="utf-8" />
    <link rel="stylesheet" href="../css/general.css" type="text/css" charset="utf-8" />
    	<link type="text/css" href="../css/demo.css" rel="stylesheet" />
</head>
<body>

 <div id="page">
<div id="wrapper">
        
        		   <div class="header_top" id="header_top"> </div>
  </div>
  <div class="header2"></div> 
	<div class="header"><!--open logo -->
		  </div><!--end header -->
	<!-- close logo-->
<!-- hide the client inquiries php-->
    <?php
    echo '<div id="nav">';
    echo '<div class="underlinemenu">';
	include('menu_view.php');
	echo '</div>';
    echo '</div>';
	?>
    <div id="header_in"> <!--open header -->
       <p> </p>
    
    <table width="100%" height="50">
     <tr>
       <td width="317" align="left" class="date"> 
        <? User::oras(); ?>
        </td>
            
       <td width="388" align="right"><? User::showPic(); ?></td>
       <td width="279">&nbsp;&nbsp;<? User::showUser(); ?>        </td>
       </tr>
   </table>
     
  
    </div>
    <div id="ex">
    </div>
    
      <p> </p>
       <div id="body"> <!--open body -->
    
	 <div id="sidebar"> 
       <!--  <div id="chef_ind"> open chef -->
        <div id="welcome"> <!--open welcome -->
           <!-- <h2 class="guilded"></h2> -->
        </div> <!--close welcome-->

<? echo '<p class="more">';
echo '';
 
   require('sideBar.php');
    
echo'</p>';
?>

        </div>
        
      <!--</div>close left -->
      
      <div id="content"> 
      <div class="desriptionHeader"> <!--open right-->
      <div id="container">
    
         <div class="post3"><h1>Administrator</h1> </div>
      
            <div class="desriptionHeader"> <!--open right-->
       <div class="postbg"><!--open booking -->
        <p> </p>
        <? 
		//this query is for news and events
		
		//this for popuplation
		//studenr
		$queryPop = "SELECT COUNT(*) AS co FROM `tbluser` WHERE user_type = 'student' AND forumaccess = 1 AND status = 'yes'";
		$quePop = mysql_query($queryPop);
		$qPop = mysql_fetch_assoc($quePop);
		$c = $qPop['co'];
		//teacher
		$queryPopu = "SELECT COUNT(*) AS cc FROM `tbluser` WHERE user_type = 'teacher'";
		$quePopu = mysql_query($queryPopu);
		$qPopu = mysql_fetch_assoc($quePopu);
		$cc = $qPopu['cc'];
		//total
		$queryPopp = "SELECT COUNT(*) AS ccc FROM `tbluser` WHERE user_type = 'student'";
		$quePopp = mysql_query($queryPopp);
		$qPopp = mysql_fetch_assoc($quePopp);
		$ccc = $qPopp['ccc'];
		
		?>
      
    <table width="95%" border="0" align="center" cellpadding="10" cellspacing="0">
  <tr>
    <td width="50%">
    <div id='basic-modal'>
    <span class="bold_">News And Events</span>
    <br />
    <?

		$que = mysql_query("SELECT * FROM `tblcms` WHERE cmsType = 'news' AND cmsStatus = 'on' LIMIT 1");
	
		while($queryRow = mysql_fetch_assoc($que)){
			print ("<a href = '#' title = 'Click to view' class='bas'><br / > ". $queryRow['cmsTitle'] ."</a><br />");
			print ("</div>");
			print ("<div id='basic-modal-content'>");
			print ("".$queryRow['cmsContent']."");
			print("</div>");
		
		}
	
	?>
   
 
 </td>
  
   
   
    
    <td width="50%">
    <span class="bold_"><b>Population as of S.Y. 10-11</b></span>
    <br/><br/>Number of Enrolled Students: <b> <? print($c);?> </b><br />
     		Total Number of Students: <b> <? print($ccc);?> </b><br />
			Number of Teachers:  <b> <? print($cc);?> </b><br />
      <p align="right"></p>
  </tr>
  <br />
  <tr>
    <td>
    <span class="bold_">Take Exams(Optional)</span>
     <br/><br/>
     <p align="right">read more</p>
     </td>
    <td>
    <span class="bold_"><b>Birthday Celebrants</b></span>
    <br/><br/>2.1.11  &ndash; Ms. Grace Habilin<br />
2.8.11  &ndash; Leeyan Santos<br />
2.12.11  &ndash; Mr. Clark Nueva<br />
2.14.11  &ndash; Mrs. Emylou Go 
     <p align="right">read more</p>
     </td>
  </tr>
</table>

	 
</div><!--close desc -->
   
        
         </div> <!--close container-->
   			
	  </div><!--close booking -->
   </div><!--close desc -->
    	</div> <!--close right-->
      <div class="clear">&nbsp;</div>
 <!-- footer-->
 <?php 
	  echo '<div id="footer">';
     include('footer_view.php');
      echo '</div>';	
	  ?>

    </div><!-- close body-->
</div><!-- close page-->


</body>
</html>



	

